#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
void solve()
{
    ll n;
    cin >> n;
    ll x, y;
    // n=x+x*10;
    // x=n/11
    ll cnt=0;
    ll now = 10;
    vector<ll> a;
    while (now<n)
    {
        ll noww = now + 1;
        if ((n / noww) * noww == n)
        {
            cnt++;
            a.push_back(n / noww);
        }
        now *= 10;
    }
    if(cnt==0)
    {
        cout << 0 << endl;
    }
    else {
        cout << cnt << endl;
        reverse(a.begin(), a.end());
        for(auto& e:a)
        {
            cout<<e<<' ';

        }
        cout << endl;
    }
}
int main()
{
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
